package cz.su.pod.reservation.dao;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public abstract class BaseDao {
	private final Logger log = LoggerFactory.getLogger(getClass());
	
	@PersistenceContext
	private EntityManager entityManager;
	
	protected EntityManager getEntityManager() {
		return entityManager;
	}
	
	public interface CRUD<T> {
		T get(String id);
		void save(T entity);		
		void delete(T entity);
	}
	
	public interface CRUDL<T> extends CRUD<T>{
		List<T> list();
	}
}
